<?php

namespace App\Models;

use Dcat\Admin\Models\Administrator;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class AdminEducation extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'admin_education';

    protected $fillable = [
        'admin_id',
        'group_id',
        'user_id',
        'title',
        'description',
        'educational_type',
        'address',
        'longitude',
        'latitude',
        'target_amount',
        'cover_path',
        'content',
        'student_name',
        'student_sex',
        'student_birthday',
        'school_id',
        'enrollment_year',
        'source',
        'class_name',
        'student_phone',
        'head_teacher',
        'head_teacher_phone',
        'guardian_name',
        'guardian_phone',
        'guardian_relation',
        'payment_info',
        'student_address',
        'online_status',
        'audit_status',
        'audit_response',
    ];

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function admin()
    {
        return $this->belongsTo(Administrator::class,'admin_id','id');
    }

    public function group()
    {
        return $this->belongsTo(Administrator::class,'group_id','id');
    }
}
